#!/bin/sh
#
# $OpenBSD: gitea.rc,v 1.3 2017/05/27 19:57:07 ajacoutot Exp $

daemon="${TRUEPREFIX}/sbin/gitea"
daemon_user="_gitea"
daemon_flags="web"

. /etc/rc.d/rc.subr

rc_bg=YES
rc_reload=NO

rc_start() {
	${rcexec} "env HOME=${LOCALSTATEDIR}/gitea USER=${daemon_user} \
		GITEA_WORK_DIR=${TRUEPREFIX}/share/gitea \
		GITEA_CUSTOM=${SYSCONFDIR}/gitea \
		${daemon} ${daemon_flags}"
}

rc_cmd $1
